<%@ tag import="com.biz.primus.base.tags.CheckType" %>
<%@ tag import="com.biz.primus.base.tags.Layout" %>
<%@ tag pageEncoding="UTF-8" %>
<%@taglib prefix="b" tagdir="/WEB-INF/tags/base" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%--标题--%>
<%@ attribute name="_title" required="true" type="java.lang.String" %>
<%--表单name--%>
<%@ attribute name="_name" required="true" type="java.lang.String" %>
<%--表单id--%>
<%@ attribute name="_id" required="false" type="java.lang.String" %>
<c:set var="_id" value="${empty _id ? _name : _id}"/>
<%--input占位符--%>
<%@ attribute name="_placeholder" required="false" type="java.lang.String" %>
<%--默认值--%>
<%@ attribute name="_value" required="false" type="java.lang.String" %>
<%--是否必填项--%>
<%@ attribute name="_required" required="false" type="java.lang.Boolean" %>
<%--布局,可选single,twin,three三个值,对应单列,双列,三列--%>
<%@ attribute name="_layout" required="false" type="com.biz.primus.base.tags.Layout" %>
<c:set var="_layout" value="<%=_layout==null?Layout.single:_layout%>"/>
<%--文本框验证类型,可选值见枚举类--%>
<%@ attribute name="_type" required="false" type="com.biz.primus.base.tags.CheckType" %>
<c:set var="_type" value="<%=_type==null?CheckType.text:_type%>"/>
<%--input class,如果有则使用--%>
<%@ attribute name="_inputClass" required="false" type="java.lang.String" %>
<c:set var="_inputClass" value="${empty _inputClass? _layout.inputClass:_inputClass}"/>
<%--输入框列宽--%>
<%@ attribute name="_inputCol" required="false" type="java.lang.Integer" %>
<c:set var="_inputCol" value="${empty _inputCol? _layout.inputCol:_inputCol}"/>
<%--标题列宽--%>
<%@ attribute name="_titleCol" required="false" type="java.lang.Integer" %>
<%--是否只读--%>
<%@ attribute name="_readOnly" required="false" type="java.lang.Boolean" %>
<c:set var="_titleCol" value="${empty _titleCol? _layout.titleCol:_titleCol}"/>
<b:row layout="${_layout}">
    <b:label title="${_title}" forId="${_id}" titleCol="${_titleCol}"/>
    <div class="col-sm-${_inputCol} form-group">
        <div class="col-xs-12">
        <input type="text" ${_readOnly?'readOnly':''} name="${_name}" id="${_id}" placeholder="${_placeholder}" class="${_inputClass} validator-${_type}" value="${_value}">
        </div>
    </div>
</b:row>
